package com.atcumt.alibaba;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Ali03 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String strs = in.nextLine();
        int count = 0;
        int res = 0;

        Map<Integer, Integer> map = new HashMap<>();
        map.put(0, 1);
        for (int i = 0; i < strs.length(); i++) {
            count = count ^ (1 << (strs.charAt(i) - 'a'));
            for (int j = 0; j < 26; j++) {
                int temp = count ^ (1 << j);
                if (map.containsKey(temp)) {
                    res += map.get(temp);
                }
            }
            map.put(count, map.getOrDefault(count, 0) + 1);
        }
        System.out.println(res);
    }
}
